import 'package:flutter/cupertino.dart';
import 'package:kq_flutter_core_widget/utils/kq_screen_util.dart';

/// 阴影组件
class ShadowWidget extends StatelessWidget {
  const ShadowWidget(
      {super.key, this.child, this.isDark = false, this.isLarge = false});

  final Widget? child;

  /// 是否使用深色阴影
  final bool isDark;

  /// 是否使用大的阴影范围
  final bool isLarge;

  @override
  Widget build(BuildContext context) {
    return DecoratedBox(
      decoration: BoxDecoration(
        boxShadow: [
          BoxShadow(
            color: isDark ? const Color(0x290E1F35) : const Color(0x260F1D2E),
            blurRadius: isLarge ? 20.r : 10.r,
            spreadRadius: 0,
            offset: Offset(0, isLarge ? 10.r : 5.r),
          ),
        ],
      ),
      child: child,
    );
  }
}
